
// ------------------------------------------------------------------------ db --------------------------------------
import { baseService, renderFormData } from '../index'

/**
 * 查询订单列表
 * @param params {{id:""}}
 * @param options
 */
export function queryOrderListApi(params:any, options:any = {}) {
    return baseService('/order', 'get', params)
}


/**
 * 上传订单文件
 * @param params {{id:""}}
 * @param options
 */
export function uploadOrderFileApi(params:any, options:any = {}) {
    const sendData = renderFormData({ ...params })
    return baseService('/order/excel', 'post', sendData, options, null, 3000000)
}


/**
 * 添加订单
 * @param params {{ {
 *   "createTime": "",
 *   "createUser": 0,
 *   "id": 0,
 *   "isDeleted": 0,
 *   "memberName": "",
 *   "number": 0,
 *   "orderPayTime": "",
 *   "orderStatus": "",
 *   "price": 0,
 *   "productName": "",
 *   "unit": "",
 *   "updateTime": "",
 *   "updateUser": 0
 * }}}
 * @param options
 */
export function createOrderApi(params:any, options:any = {}) {
    return baseService('/order', 'post', params)
}


/**
 * 修改订单
 * @param params {{ {
 *   "createTime": "",
 *   "createUser": 0,
 *   "id": 0,
 *   "isDeleted": 0,
 *   "memberName": "",
 *   "number": 0,
 *   "orderPayTime": "",
 *   "orderStatus": "",
 *   "price": 0,
 *   "productName": "",
 *   "unit": "",
 *   "updateTime": "",
 *   "updateUser": 0
 * }}}
 * @param options
 */
export function updateOrderApi(params:any, options:any = {}) {
    return baseService('/order', 'put', params)
}

/**
 * 批量删除
 * @param params
 * @param options
 */
export function deleteOrderApi(params:any, options:any = {}) {
    return baseService('/order', 'deleteBody', params)
}

/**
 * 会计算金额
 * @param params {{memberName	买家会员名	query	false
 * orderPayTimeEnd	订单筛选付款结束时间	query	false
 * orderPayTimeStart	订单筛选付款开始时间}}
 * @param options
 */
export function countOrderApi(params:any, options:any = {}) {
    return baseService('/order/compute', 'get', params)
}

